package com.example.myapplication.util;

import android.content.Context;

import com.example.myapplication.MyApplication;

public class SpUtil {
    public  static String key="key";

    public static void saveLoginPhone(String phone){
        MyApplication.myApp.getSharedPreferences(key,Context.MODE_PRIVATE).edit().putString("loginedPhone",phone).apply();
    }
    public static String getLoginPhone(){
        return MyApplication.myApp.getSharedPreferences(key,Context.MODE_PRIVATE).getString("loginedPhone",null);

    }

    public static void saveLoginStatus(boolean b){
        MyApplication.myApp.getSharedPreferences(key,Context.MODE_PRIVATE).edit().putBoolean("loginStatus",b).apply();
    }
    public  static boolean getLoginStatus(){
       return MyApplication.myApp.getSharedPreferences(key,Context.MODE_PRIVATE).getBoolean("loginStatus",false);
    }
}
